import { S } from '../../s';
import { IPSDELogic } from './ipsdelogic';
import { IPSDELogicParam } from './ipsdelogic-param';
import { IPSDEThrowExceptionLogic } from './ipsdethrow-exception-logic';
import { PSDELogicNodeImpl } from './psdelogic-node-impl';

export class PSDEThrowExceptionLogicImpl
  extends PSDELogicNodeImpl
  implements IPSDEThrowExceptionLogic
{
  get errorCode(): number {
    return this.M.errorCode;
  }

  get errorInfo(): string {
    return this.M.errorInfo;
  }

  get exceptionObj(): string {
    return this.M.exceptionObj;
  }

  protected exceptionparam: IPSDELogicParam;
  getExceptionParam(): IPSDELogicParam | null {
    if (this.exceptionparam != null) return this.exceptionparam;
    const value = this.M.getExceptionParam;
    if (value == null) {
      return;
    }
    const ipsdelogic = this.getParentPSModelObject(S._200) as IPSDELogic;
    if (ipsdelogic != null) {
      this.exceptionparam = ipsdelogic.findPSDELogicParam(value);
    }
    return this.exceptionparam;
  }
  get cls(): string {
    return 'PSDEThrowExceptionLogicImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1e2) return true;
    return super.instanceof(cls);
  }
}
